<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/diaShop/css/common.css" rel="stylesheet" type="text/css"/>
    <link href="/diaShop/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/diaShop/fonts/iconfont.css" rel="stylesheet" type="text/css"/>
    <script src="/diaShop/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/diaShop/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
    <script src="/diaShop/js/common_js.js" type="text/javascript"></script>
    <script src="/diaShop/js/footer.js" type="text/javascript"></script>
    <script src="/diaShop/js/lrtk.js" type="text/javascript"></script>
    <title>产品列表</title>
</head>
<script type="text/javascript" charset="UTF-8">
    <!--
    //点击效果start
    function infonav_more_down(index) {
        var inHeight = ($("div[class='p_f_name infonav_hidden']").eq(index).find('p').length) * 30;//先设置了P的高度，然后计算所有P的高度
        if (inHeight > 60) {
            $("div[class='p_f_name infonav_hidden']").eq(index).animate({height: inHeight});
            $(".infonav_more").eq(index).replaceWith('<p class="infonav_more"><a class="more"  onclick="infonav_more_up(' + index + ');return false;" href="javascript:">收起<em class="pulldown"></em></a></p>');
        } else {
            return false;
        }
    }

    function infonav_more_up(index) {
        var infonav_height = 85;
        $("div[class='p_f_name infonav_hidden']").eq(index).animate({height: infonav_height});
        $(".infonav_more").eq(index).replaceWith('<p class="infonav_more"> <a class="more" onclick="infonav_more_down(' + index + ');return false;" href="javascript:">更多<em class="pullup"></em></a></p>');
    }

    function onclick(event) {
        info_more_down();
        return false;
    }

    //点击效果end
    //-->
</script>
<body>
<!--顶部图层-->
<div th:replace="diaShop/layout/mallHeader"></div>

<!--内容样式-->
<div class="Inside_pages">

    <!--位置-->
    <div class="Location_link">
        <em></em><a href="#">进口食品、进口牛</a> &lt; <a href="#">进口饼干/糕点</a>
    </div>
    <!--筛选样式-->
    <div id="Filter_style">
        <!--推荐-->
        <div class="page_recommend">
            <div class="hd"><em></em>今日推荐
                <ul></ul>
            </div>
            <div class="bd">
                <ul>

                    <li th:each="com:${commList}">
                        <div class="img"><a th:href="@{'/diaShop/goodsDetail/'+${com.id}}">
                            <img th:src="@{${com.img}}" width="120" height="120"/></a></div>
                        <div class="pro_info">
                            <a th:href="@{'/diaShop/goodsDetail/'+${com.id}}" th:text="${com.title}">洗颜专科</a>
                            <p class="Price" th:text="'￥'+${com.prices}">￥231.00</p>
                            <p class="Sales">热销：<b th:text="${com.sellhit}">1234</b>件</p>
                        </div>
                    </li>

                </ul>
            </div>
            <a class="next" href="javascript:void(0)"><em class="iconfont icon-left"></em></a>
            <a class="prev" href="javascript:void(0)"><em class="iconfont icon-right"></em></a>
        </div>
        <script type="text/javascript">
            jQuery(".page_recommend").slide({
                titCell: ".hd ul",
                mainCell: ".bd ul",
                autoPage: true,
                effect: "left",
                autoPlay: true,
                vis: 4,
                trigger: "click"
            });
        </script>
        <div class="Filter">
            <div class="Filter_list clearfix">
                <div class="Filter_title"><span>品牌：</span></div>
                <div class="Filter_Entire"><a href="#">全部</a></div>
                <div class="p_f_name infonav_hidden">
                    <p>
                        <a th:each="brand:${brandList}" th:if="${brandList}"
                           th:href="@{'/diaShop/goodsByBrand/'+${brand.id}}"
                           th:text="${brand.name}">奶粉（1244）</a>
                    </p>

                </div>
                <p class="infonav_more"><a href="/diaShop/brandList" class="more"
                                           onclick="infonav_more_down(0);return false;">更多<em
                        class="pullup"></em></a></p>
            </div>

            <div class="Filter_list clearfix">
                <div class="Filter_title"><span>包装方式：</span></div>
                <div class="Filter_Entire"><a href="#">全部</a></div>
                <div class="p_f_name">
                    <a th:each="type:${typeList}" th:if="${typeList}" th:href="@{'/diaShop/goodsByClass/'+${type.id}}"
                       th:text="${type.name}">奶粉（1244）</a>

                </div>
            </div>
        </div>
    </div>
    <!--样式-->
    <div class="scrollsidebar side_green clearfix" id="scrollsidebar">
        <div class="show_btn" id="rightArrow"><span></span></div>
        <div class="page_left_style side_content">
            <!--浏览记录-->
            <div class="side_title"><a title="隐藏" class="close_btn"><span></span></a></div>
            <div class=" side_list">
                <div class="Record">
                    <div class="title_name">新品上市</div>
                    <ul>
                        <li th:each="xinpin:${xinpinList}">
                            <a th:href="@{'/diaShop/goodsDetail/'+${xinpin.id}}">
                                <p><img th:src="@{${xinpin.img}}"></p>
                                <p class="p_name" th:text="${xinpin.title}">商品名称</p>
                            </a>
                            <p><span class="p_Price left">价格:<b th:text="'￥'+${xinpin.prices}">￥5.30</b></span><span
                                    class="p_Sales right" th:text="'销量：'+${xinpin.sellhit}">销量：2345件</span></p>
                        </li>

                    </ul>
                </div>
                <!--销售排行-->
                <div class="pro_ranking">
                    <div class="title_name"><em></em>销量排行</div>
                    <div class="ranking_list">
                        <ul id="tabRank">

                            <li class="t_p on" th:each="sell,iterStat:${sellList}">
                                <em class="icon_ranking" th:text="${iterStat.count}">1</em>
                                <dt>
                                    <h3><a th:href="@{'/diaShop/goodsDetail/'+${sell.id}}" th:text="${sell.title}">韩束墨
                                        深层）</a></h3></dt>
                                <dd class="clearfix">
                                    <a th:href="@{'/diaShop/goodsDetail/'+${sell.id}}">
                                        <img th:src="@{${sell.img}}" width="90" height="90"/></a>
                                    <span class="Price" th:text="'￥'+${sell.prices}">￥23.00</span>
                                </dd>
                            </li>

                        </ul>
                    </div>
                </div>
                <script type="text/javascript">
                    jQuery("#tabRank li").hover(function () {
                        jQuery(this).addClass("on").siblings().removeClass("on")
                    }, function () {
                    });
                    jQuery("#tabRank").slide({
                        titCell: "dt h3",
                        autoPlay: false,
                        effect: "left",
                        delayTime: 300
                    });    </script>
            </div>
        </div>
        <div class="page_right_style">
            <!--排序样式-->
            <script type="text/javascript">
                $(function () {
                    $("#scrollsidebar").fix({
                        float: 'left',
                        //minStatue : true,
                        skin: 'green',
                        durationTime: 600
                    });
                });
            </script>
            <div id="Sorted" class="fixToTop">
                <div class="Sorted">
                    <div class="Sorted_style">
                        <a href="#" class="on">综合<i class="iconfont icon-pullup"></i></a>
                        <a href="#">销量<i class="iconfont icon-pullup"></i></a>
                        <a href="#">价格<i class="iconfont icon-pullup"></i></a>
                        <a href="#">新品<i class="iconfont icon-pullup"></i></a>
                    </div>
                    <!--产品搜索-->
                    <div class="product_search">
                        <input name="" type="text" class="search_text" value="请输入你要搜索的产品" onfocus="this.value=''"
                               onblur="if(!value){value=defaultValue;}"><input name="" type="submit" value=""
                                                                               class="search_btn">
                    </div>
                    <!--页数-->
                    <div class="s_Paging">
                        <span> 1/12</span>
                        <a href="#" class="on">&lt;</a>
                        <a href="#">&gt;</a>
                    </div>
                </div>
            </div>
            <!--结束-->
            <!--产品列表样式-->
            <div class="p_list  clearfix">
                <ul>
                    <li class="gl-item" th:if="${data.rows}" th:each="goods:${data.rows}">
                        <div class="Borders">
                            <div class="img"><a th:href="@{'/diaShop/goodsDetail/'+${goods.id}}">
                                <img th:src="@{${goods.col2}}" style="width:220px;height:220px"></a></div>
                            <div class="Price"><b th:text="'￥'+${goods.col1}">¥89</b><span></span></div>
                            <div class="name"><a th:href="@{'/diaShop/goodsDetail/'+${goods.id}}"
                                                 th:utext="${goods.title}">乐事 </a></div>
                            <div class="Review">已有<a href="#">2345</a>评论</div>
                            <div class="p-operate">
                                <a href="#" class="p-o-btn Collect"><em></em>收藏</a>
                                <a href="#" th:onclick="'addCart('+${goods.id}+')'" class="p-o-btn shop_cart"><em></em>加入购物车</a>
                            </div>
                        </div>
                    </li>

                </ul>
                <div class="Paging">
                    <div class="Pagination">
                        <a href="#">首页</a>
                        <a href="#" class="pn-prev disabled">&lt;上一页</a>
                        <a href="#" class="on">1</a>
                        <a href="#">2</a>
                        <a href="#">3</a>
                        <a href="#">4</a>
                        <a href="#">下一页&gt;</a>
                        <a href="#">尾页</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="application/javascript">
    function addCart(goodsid) {
        var count = 1;
        $.ajax({
            type: "post",
            url: '/person/diaShop/addCart',
            data: {
                goodsid: goodsid,
                count: count
            },
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    window.location.href = "/person/diaShop/likBuy/" + goodsid;
                } else if (data.success == 'login') {
                    window.location.href = "/diaShop/login"
                }
            }
        });
    }
</script>
<div th:replace="diaShop/layout/mallFooter"></div>
</body>
</html>
